// Created by wangliang on 2025/6/27.

import 'package:flutter/material.dart';
import 'package:flutter_app_demo/base/base_view_model.dart';
import 'package:flutter_app_demo/base/widget/common_app_bar.dart';
import 'package:go_router/go_router.dart';
import 'package:mvvm_plus/mvvm_plus.dart';

class LivePage extends ViewWidget<LivePageViewModel> {
  LivePage({super.key}) : super(builder: () => LivePageViewModel());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CommonAppBar(
        onBackPressed: () => context.pop(),
        title: '直播主页',
      ),
      body: Column(
        children: [TextButton(onPressed: () => viewModel.launchCameraPush(), child: Text('推流'))],
      ),
    );
  }
}

class LivePageViewModel extends BaseViewModel {
  launchCameraPush() {
    context.push('/live/push/camera');
  }
}
